package com.yiren.backstage.currency.entity;

import org.greenrobot.greendao.DaoException;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Property;
import org.greenrobot.greendao.annotation.ToOne;
import com.yiren.backstage.db.dao.DaoSession;
import com.yiren.backstage.db.dao.ProjectEntityDao;
import com.yiren.backstage.db.dao.GradeStandardEntityDao;

/**
 * Time:2021/11/09 15:14
 * Author:xiaozan
 * Description:评分标准 bean
 */
@Entity(nameInDb = "grade_standard",createInDb = false)
public class GradeStandardEntity {
    @Id
    private String id;

    /**标准评分内容*/
    private String standardContent;

    /**
     * 标准评分内容 语音文件名称-选择语音文件时
     * 内容为空时：取评分内容合成播报
     * 内容不为空时：根据当前语音文件名称播报本地语音
     */
    private String standardVoiceName;

    /**
     * 简写评分内容 语音文件名称-选择语音文件时
     * 内容为空时：取评分内容合成播报
     * 内容不为空时：根据当前语音文件名称播报本地语音
     */
    private String abbreviationContent;

    /**简写评分内容 语音文件名称-选择语音文件时*/
    private String abbreviationVoiceName;

    /**扣分分数*/
    private int grade;

    /**扣分编码*/
    private String code;

    /**所属项目*/
    private String projectId;
    @ToOne(joinProperty = "projectId")
    private ProjectEntity projectEntity;

    /**是否是人工评判*/
    private boolean artificialJudge;

    /** Used to resolve relations */
    @Generated(hash = 2040040024)
    private transient DaoSession daoSession;

    /** Used for active entity operations. */
    @Generated(hash = 1042653092)
    private transient GradeStandardEntityDao myDao;

    @Generated(hash = 1761973184)
    public GradeStandardEntity(String id, String standardContent, String standardVoiceName,
            String abbreviationContent, String abbreviationVoiceName, int grade, String code,
            String projectId, boolean artificialJudge) {
        this.id = id;
        this.standardContent = standardContent;
        this.standardVoiceName = standardVoiceName;
        this.abbreviationContent = abbreviationContent;
        this.abbreviationVoiceName = abbreviationVoiceName;
        this.grade = grade;
        this.code = code;
        this.projectId = projectId;
        this.artificialJudge = artificialJudge;
    }

    @Generated(hash = 1452971911)
    public GradeStandardEntity() {
    }

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getStandardContent() {
        return this.standardContent;
    }

    public void setStandardContent(String standardContent) {
        this.standardContent = standardContent;
    }

    public String getAbbreviationContent() {
        return this.abbreviationContent;
    }

    public void setAbbreviationContent(String abbreviationContent) {
        this.abbreviationContent = abbreviationContent;
    }

    public int getGrade() {
        return this.grade;
    }

    public void setGrade(int grade) {
        this.grade = grade;
    }

    public String getCode() {
        return this.code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getProjectId() {
        return this.projectId;
    }

    public void setProjectId(String projectId) {
        this.projectId = projectId;
    }

    public boolean getArtificialJudge() {
        return this.artificialJudge;
    }

    public void setArtificialJudge(boolean artificialJudge) {
        this.artificialJudge = artificialJudge;
    }

    @Generated(hash = 374302873)
    private transient String projectEntity__resolvedKey;

    /** To-one relationship, resolved on first access. */
    @Generated(hash = 78254166)
    public ProjectEntity getProjectEntity() {
        String __key = this.projectId;
        if (projectEntity__resolvedKey == null
                || projectEntity__resolvedKey != __key) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            ProjectEntityDao targetDao = daoSession.getProjectEntityDao();
            ProjectEntity projectEntityNew = targetDao.load(__key);
            synchronized (this) {
                projectEntity = projectEntityNew;
                projectEntity__resolvedKey = __key;
            }
        }
        return projectEntity;
    }

    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 36797379)
    public void setProjectEntity(ProjectEntity projectEntity) {
        synchronized (this) {
            this.projectEntity = projectEntity;
            projectId = projectEntity == null ? null : projectEntity.getId();
            projectEntity__resolvedKey = projectId;
        }
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 128553479)
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 1942392019)
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 713229351)
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }

    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 618457285)
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getGradeStandardEntityDao() : null;
    }

    public String getStandardVoiceName() {
        return this.standardVoiceName;
    }

    public void setStandardVoiceName(String standardVoiceName) {
        this.standardVoiceName = standardVoiceName;
    }

    public String getAbbreviationVoiceName() {
        return this.abbreviationVoiceName;
    }

    public void setAbbreviationVoiceName(String abbreviationVoiceName) {
        this.abbreviationVoiceName = abbreviationVoiceName;
    }
}
